//获取应用实例
var app = getApp();
Page({
    data: {
        
    },
    onShow:function(){
    },
    onLoad: function (options) {
      var that = this;
      //获取手机高度
      that.setData({
        navH: app.globalData.navHeight,
        invitationPrice: wx.getStorageSync("invitationPrice"),
      })

      wx.request({
        url: app.globalData.url + "getParaById",
        header: {
          "content-type": "application/x-www-form-urlencoded"
        },
        data: {
          paraId: 'invite_user_rules',
        },
        method: "POST",
        success: function (res) {
          var data = res.data;
          if (data.result === 1) {
            var str = res.data.data.value.split("\\n");
            that.setData({
              value: str,
            })
          }
        }
      });
      wx.request({
        url: app.globalData.url + "getAdvertisementListByType",
        header: {
          "content-type": "application/x-www-form-urlencoded"
        },
        data: {
          advertisingType: 3,
        },
        method: "POST",
        success: function (res) {
          var data = res.data;
          if (data.result === 1) {
            that.setData({
              advertisement:data.data
            })
          }
        }
      });

    },
    navBack: function () {
      var that = this;
      console.info(that.data.back);
        wx.switchTab({
          url: '/pages/mallPage/mallPage'
        })
    },
  /**
 * 页面分享
 */
  onShareAppMessage: function () {
    var that = this;
    return {
      title: '极味生鲜',
      desc: '分享页面的内容',
      imageUrl: "http://file.jwsxmall.com/shareImg.jpg",
      path: '/pages/mallPage/mallPage?partnerUserId=' + wx.getStorageSync("userId"), // 路径，传递参数到指定页面
    }
  },
})
